#include "Cuadrado.h"


//Constructoras y Destructoras
Cuadrado::Cuadrado(void)
{
	this->p1 = new PV2D();
	this->p2 = new PV2D();
	this->p3 = new PV2D();
	this->p4 = new PV2D();
	this->r = 1.0f;
	this->g = 1.0f;
	this->b = 1.0f;
}
Cuadrado::Cuadrado(const Cuadrado &c)
{
	this->p1 = c.p1->clone();
	this->p2 = c.p2->clone();
	this->p3 = c.p3->clone();
	this->p4 = c.p4->clone();
	this->r = c.r;
	this->g = c.g;
	this->b = c.b;

}

Cuadrado::Cuadrado(const PV2D &p1, const PV2D &p2, const PV2D &p3, const PV2D &p4)
{
	this->p1 = new PV2D(p1);
	this->p2 = new PV2D(p2);
	this->p3 = new PV2D(p3);
	this->p4 = new PV2D(p4);
	this->r = 1.0f;
	this->g = 1.0f;
	this->b = 1.0f;
}

Cuadrado::Cuadrado(const PV2D &p1, const PV2D &p2, const PV2D &p3, const PV2D &p4, GLfloat r, GLfloat g, GLfloat b)
{
	this->p1 = new PV2D(p1);
	this->p2 = new PV2D(p2);
	this->p3 = new PV2D(p3);
	this->p4 = new PV2D(p4);
	this->r = r;
	this->g = g;
	this->b = b;
}
	
Cuadrado::~Cuadrado(void)
{
	if (p1) delete p1;
	if (p2) delete p2;
	if (p3) delete p3;
	if (p4) delete p4;
	p1 = p2 = p3 = p4 = 0;
}
